﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace XGameFrame
{
    /// <summary>
    /// Class to manage maps
    /// </summary>
    public class MapManager : List<MapBase>
    {
        #region Field
        static SpriteFont spriteFont;
        #endregion

        #region Properties
        public static SpriteFont SpriteFont
        {
            get { return spriteFont; }
        }
        #endregion

        #region Constructor
        public MapManager(SpriteFont pSpriteFont)
            : base()
        {
            MapManager.spriteFont = pSpriteFont;
        }
        public MapManager(SpriteFont pSpriteFont, int pCapacity)
            : base(pCapacity)
        {
            MapManager.spriteFont = pSpriteFont;
        }
        public MapManager(SpriteFont pSpriteFont, IEnumerable<MapBase> pCollection)
            : base(pCollection)
        {
            MapManager.spriteFont = pSpriteFont;
        }
        #endregion

        #region Methods

        public void Update(GameTime pGameTime, PlayerIndex pPlayerIndex)
        {

        }

        public void Draw(SpriteBatch pSpriteBatch)
        {
            foreach(MapBase _map in this)
            {
                _map.Draw(pSpriteBatch);
            }
        }

        #endregion

    }
}
